package com.experiment.aicommunityback.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.experiment.aicommunityback.entity.GoodsType;
import com.experiment.aicommunityback.entity.dto.GoodsDTO;
import com.experiment.aicommunityback.entity.dto.GoodsTypeDTO;
import com.experiment.aicommunityback.entity.dto.GoodsTypeFirstChildDTO;
import com.experiment.aicommunityback.entity.dto.GoodsTypeSecondChildDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GoodsTypeMapper extends BaseMapper<GoodsType> {
    @Select("SELECT MIN(st.id) AS id,  st.type_name,st.super_type " +
            "FROM sys_goods_type st\n" +
            "WHERE st.super_type = 0\n" +
            "GROUP BY st.type_name")
    List<GoodsDTO> selectGoodsWithTypeInfo();



    List<GoodsTypeSecondChildDTO> getSecondTypeGoodsList();

    List<GoodsTypeFirstChildDTO> getAllFirstGoodsType();
}
